﻿using Eamon.MeituanDotnetSDK.utils;

namespace Eamon.MeituanDotnetSDK.api.common.response
{
    /// <summary>
    /// API响应结果类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [Serializable]
    public class MeituanResponse<T> : BaseResponse
    {
        public T Data { get; set; }
        public MeituanResponse()
        {
        }

        public virtual bool IsSuccess()
        {
            return Code == CommonConstants.OP_SUCCESS;
        }

        public override string ToString()
        {
            return $"MeituanResponse{{code='{Code}', msg='{Msg}', traceId='{TraceId}', data={Data}}}";
        }
    }
}
